package com.hooda.container;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zhangzp
 * @version 1.0, 2021/10/15
 */
public class Engine {

    private Host empty = new Host(null);

    private Map<String, Host> hosts = new HashMap<>();

    public Engine() {

    }

    public Host getHost(String site) {
        if (hosts.containsKey(site)) {
            return hosts.get(site);
        }
        return empty;
    }

    public void addHost(String site, String appBase) {
        hosts.put(site, new Host(appBase));
    }
}
